<div class="panel">
    <div class="panel-heading">
        查询菜单
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-4">
                <div class="input-group">
                    <span class="input-group-addon">菜单编码</span>
                    <input type="text" id="queryMenuCode" name="queryMenuCode" class="form-control" placeholder="">
                </div>
            </div>
            <div class="col-md-4">
                <div class="input-group">
                    <span class="input-group-addon">菜单名称</span>
                    <input type="text" id="queryMenuNameLike" name="queryMenuNameLike" class="form-control"
                           placeholder="">
                </div>
            </div>
            <div class="col-md-4">
                <button class="btn btn-success" type="button" id="searchBtn"><i class="fa fa-search"
                                                                                aria-hidden="true"></i>搜索
                </button>
            </div>
        </div>
    </div>
</div>
<div class="datagrid">
    <div class="search-box">
        <button class="btn btn-success " type="button"
                data-toggle="modal" data-target="#addModal" id="addBtn"><i class="fa fa-plus" aria-hidden="true"></i>新增
        </button>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <button class="btn btn-info " type="button" id="updateBtn"><i class="fa fa-edit"></i>修改</button>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <button class="btn btn-danger " type="button" id="deleteBtn"><i class="fa fa-trash"></i>删除</button>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <button class="btn " type="button" id="detailBtn"><i class="fa fa-info"></i>详情</button>
    </div>
    <div class="datagrid datagrid-striped" id="listDataGrid" data-ride="datagrid"></div>
    <div id="listPager" class="pager" data-ride="pager"></div>
</div>
<!-- 添加页面 -->
<div class="modal fade" id="addModal" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">添加菜单</h4>
            </div>
            <form id="addForm">
                <div class="modal-body">
                    <div class="form-horizontal">
                        <div class="form-group">
                            <label for="name" class="col-sm-3 control-label">菜单名:<font color="red">*</font></label>
                            <div class="col-sm-9">
                                <input class="form-control" id="name" name="name" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="parentId" class="col-sm-3 control-label">是否为上级菜单:<font color="red">*</font></label>
                            <div class="col-sm-9">
                                <select class="form-control" id="parentId" name="parentId" onclick="if($(this).val() == 0){disable()}else if($(this).val() == 1){ enable()}">
                                    <option value="0" selected>是</option>
                                    <option value="1">否</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="priority" class="col-sm-3 control-label">上级菜单名称:<font color="red">*</font></label>
                            <div class="col-sm-9">
                                <select class="form-control" id="priority" name="priority" disabled>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="url" class="col-sm-3 control-label">菜单路劲:<font color="red">*</font></label>
                            <div class="col-sm-9">
                                <input class="form-control" id="url" name="url" type="text">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <div class="center-block">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="submit" id="addSaveBtn" class="btn btn-primary">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<!--修改界面-->
<div class="modal fade" id="updateModal" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">修改菜单信息</h4>
            </div>
            <form id="updateForm">
                <div class="modal-body">
                    <div class="form-horizontal">
                        <div class="form-group">
                            <label for="name" class="col-sm-3 control-label">菜单名:<font color="red">*</font></label>
                            <div class="col-sm-9">
                                <input class="form-control" id="updateName" name="updateName" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="url" class="col-sm-3 control-label">菜单URL:<font color="red">*</font></label>
                            <div class="col-sm-9">
                                <input class="form-control" id="updateUrl" name="updateUrl" type="text">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <div class="center-block">
                        <input type="hidden" name="updateMenuId" id="updateMenuId"/>
                        <input type="hidden" name="updateMenuName" id="updateMenuName"/>
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="submit" id="updateSaveBtn" class="btn btn-primary">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- 删除确认 -->
<div class="modal fade" id="deleteModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
                <h4 class="modal-title">删除菜单</h4>
            </div>
            <div class="modal-body text-center">
                <H3>您确定要删除此菜单吗?</H3>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="deleteMenuBtn">确定</button>
            </div>
        </div>
    </div>
</div>
<!--详情界面-->
<div class="modal fade" id="detailModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">菜单详情</h4>
            </div>
            <form id="detailForm">
                <div class="modal-body">
                    <div class="form-horizontal">
                        <div class="form-group">
                            <label for="name" class="col-sm-3 control-label">菜单名:<font color="red">*</font></label>
                            <div class="col-sm-9">
                                <span id="detailName"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="url" class="col-sm-3 control-label">创建时间:<font color="red">*</font></label>
                            <div class="col-sm-9">
                                <span id="detailCTime"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="url" class="col-sm-3 control-label">更新时间:<font color="red">*</font></label>
                            <div class="col-sm-9">
                                <span id="detailUTime"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="url" class="col-sm-3 control-label">是否为上级菜单:<font color="red">*</font></label>
                            <div class="col-sm-9">
                                <span id="detailParentId"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="url" class="col-sm-3 control-label">菜单URL:<font color="red">*</font></label>
                            <div class="col-sm-9">
                                <span id="detailUrl"></span>
                            </div>
                        </div>
                    </div>
                </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
            </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<script type="text/javascript" src="/js/messages_zh.js"></script>
<script type="text/javascript" src="/js/menu/menu.js"></script>